//
//  NSString+Size.m
//  LC_CY_SDK
//
//  Created by LC on 16/11/12.
//  Copyright © 2016年 LC. All rights reserved.
//

#import "NSString+Size.h"

@implementation NSString (Size)

- (CGSize)sizeWithTextFont:(UIFont *)font {
    
    NSMutableDictionary *attr = [NSMutableDictionary dictionary];
    attr[NSFontAttributeName] = font;
    
    return [self sizeWithAttributes:attr];
}

-(CGRect)sizeWithTextFont:(UIFont *)font maxSize:(CGSize)maxSize {
    NSMutableDictionary *attr = [NSMutableDictionary dictionary];
    attr[NSFontAttributeName] = font;
    return [self boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:attr context:nil];
}
@end
